import requests


# 定义类--登录接口
class IhrmLoin(object):
    # 登录方法
    def login(self, req_body):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/login", json=req_body)
        return resp


if __name__ == '__main__':
    ihrm_login = IhrmLoin()
    #req_body数据
    req_body={"mobile": "13800000002","password": "123456"}
    #密码错误
    # req_body = {"mobile": "13800000002", "password": "12345"}
    #无参
    # req_body = None
    ret=ihrm_login.login(req_body)
    print(ret.json())